<?php
require "../../sesi_login.php";
require "../../konfigurasi.php";
require "../../functions/umum.php";

if(isset($_POST['data']) && $_POST['data']=="tambah") {
	koneksi_buka();
	$nip = $_POST['nip'];
	$nama = $_POST['nama'];
	$pangkat = $_POST['pangkat'];
	$alamat = $_POST['alamat'];
	$telp = $_POST['telp'];
	$hp = $_POST['hp'];
	
	mysql_query("INSERT INTO t_jaksa VALUES('$nip','$pangkat','0','$nama','$alamat','$telp','$hp')");
	
	header("Location:../../jaksa.php");
	
	koneksi_tutup();
} elseif(isset($_POST['data']) && $_POST['data']=="ubah") {
	koneksi_buka();
	
	koneksi_tutup();
} elseif(isset($_GET['nip']) && $_GET['nip']!="") {
	koneksi_buka();
	mysql_query("DELETE FROM t_jaksa WHERE nip='".$_GET['nip']."'");
	header("Location:../../jaksa.php");
	koneksi_tutup();
} else {
	header("Location:../../jaksa.php");
}
?>
